#include "StdAfx.h"
#include "PledgeDiYaModel.h"


CPledgeDiYaModel::CPledgeDiYaModel(void)
{
	m_id= 0;
	m_productID = 0;
	m_bankSjrq = 0;
	m_zlfCzrq = 0;
	m_pgfCzrq = 0;
	m_pfrqJhrq = 0;
	m_pfrqSjrq = 0;
	m_gzJhrq = 0;
	m_gzSjrq = 0;
	m_slJhckrq = 0;
	m_slCksjrq = 0;
	m_slHtts = 0;
	m_slSjts = 0;
	m_dydjJhrq = 0;
	m_dydjSjrq = 0;
	m_dydjCzrq = 0;
	m_dcJhrq = 0;
	m_dcSjrq = 0;
	m_dcJhts = 0;
	m_dcSjts = 0;
	m_dcZqts1 = 0;
	m_dcZqts2 = 0;
	m_slZqts = 0;
}

CPledgeDiYaModel::~CPledgeDiYaModel(void)
{
}

void CPledgeDiYaModel::parseFromJson(Json::Value& jsonData)
{
	if (!jsonData["id"].isNull())
	{
		m_id = jsonData["id"].asInt();
	}
	if (!jsonData["productID"].isNull())
	{
		m_productID = jsonData["productID"].asInt();
	}
	CUtils::getJsonStringField(jsonData, "tdType", m_tdType);
	CUtils::getJsonStringField(jsonData, "loanBank", m_loanBank);
	if (!jsonData["bankJhrq"].isNull())
	{
		m_bankJhrq = jsonData["bankJhrq"].asInt64();
	}
	if (!jsonData["bankSjrq"].isNull())
	{
		m_bankSjrq = jsonData["bankSjrq"].asInt64();
	}
	if (!jsonData["zlfCzrq"].isNull())
	{
		m_zlfCzrq = jsonData["zlfCzrq"].asInt64();
	}
	CUtils::getJsonStringField(jsonData, "zlfJe", m_zlfJe);
	if (!jsonData["pgfCzrq"].isNull())
	{
		m_pgfCzrq = jsonData["pgfCzrq"].asInt64();
	}
	CUtils::getJsonStringField(jsonData, "pgfCzje", m_pgfCzje);
	if (!jsonData["pfrqJhrq"].isNull())
	{
		m_pfrqJhrq = jsonData["pfrqJhrq"].asInt64();
	}
	if (!jsonData["pfrqSjrq"].isNull())
	{
		m_pfrqSjrq = jsonData["pfrqSjrq"].asInt64();
	}
	if (!jsonData["gzJhrq"].isNull())
	{
		m_gzJhrq = jsonData["gzJhrq"].asInt64();
	}
	if (!jsonData["gzSjrq"].isNull())
	{
		m_gzSjrq = jsonData["gzSjrq"].asInt64();
	}
	if (!jsonData["slJhckrq"].isNull())
	{
		m_slJhckrq = jsonData["slJhckrq"].asInt64();
	}
	if (!jsonData["slCksjrq"].isNull())
	{
		m_slCksjrq = jsonData["slCksjrq"].asInt64();
	}
	CUtils::getJsonStringField(jsonData, "slAjjhje", m_slAjjhje);
	CUtils::getJsonStringField(jsonData, "slAjsjje", m_slAjsjje);
	CUtils::getJsonStringField(jsonData, "slBankjqbj", m_slBankjqbj);
	CUtils::getJsonStringField(jsonData, "slBankjqlx", m_slBankjqlx);
	CUtils::getJsonStringField(jsonData, "slHtje", m_slHtje);
	CUtils::getJsonStringField(jsonData, "slSjsyje", m_slSjsyje);
	if (!jsonData["slHtts"].isNull())
	{
		m_slHtts = jsonData["slHtts"].asInt();
	}
	CUtils::getJsonStringField(jsonData, "slHtrx", m_slHtrx);
	if (!jsonData["slSjts"].isNull())
	{
		m_slSjts = jsonData["slSjts"].asInt();
	}
	CUtils::getJsonStringField(jsonData, "slSjrx", m_slSjrx);
	if (!jsonData["slZqts"].isNull())
	{
		m_slZqts = jsonData["slZqts"].asInt();
	}
	CUtils::getJsonStringField(jsonData, "slZqrx", m_slZqrx);
	if (!jsonData["dydjJhrq"].isNull())
	{
		m_dydjJhrq = jsonData["dydjJhrq"].asInt64();
	}
	if (!jsonData["dydjSjrq"].isNull())
	{
		m_dydjSjrq = jsonData["dydjSjrq"].asInt64();
	}
	if (!jsonData["dydjCzrq"].isNull())
	{
		m_dydjCzrq = jsonData["dydjCzrq"].asInt64();
	}
	CUtils::getJsonStringField(jsonData, "dydjCzje", m_dydjCzje);
	CUtils::getJsonStringField(jsonData, "txfJhje", m_txfJhje);
	CUtils::getJsonStringField(jsonData, "txfSjje", m_txfSjje);
	CUtils::getJsonStringField(jsonData, "dgzhJhje", m_dgzhJhje);
	CUtils::getJsonStringField(jsonData, "dgzhSjje", m_dgzhSjje);
	if (!jsonData["dcJhrq"].isNull())
	{
		m_dcJhrq = jsonData["dcJhrq"].asInt64();
	}
	if (!jsonData["dcSjrq"].isNull())
	{
		m_dcSjrq = jsonData["dcSjrq"].asInt64();
	}
	CUtils::getJsonStringField(jsonData, "dcJhje", m_dcJhje);
	CUtils::getJsonStringField(jsonData, "dcSjje", m_dcSjje);
	if (!jsonData["dcJhts"].isNull())
	{
		m_dcJhts = jsonData["dcJhts"].asInt();
	}
	if (!jsonData["dcSjts"].isNull())
	{
		m_dcSjts = jsonData["dcSjts"].asInt();
	}
	CUtils::getJsonStringField(jsonData, "dcJhrx", m_dcJhrx);
	CUtils::getJsonStringField(jsonData, "dcSjrx", m_dcSjrx);
	if (!jsonData["dcZqts1"].isNull())
	{
		m_dcZqts1 = jsonData["dcZqts1"].asInt();
	}
	CUtils::getJsonStringField(jsonData, "dcZqrx1", m_dcZqrx1);
	if (!jsonData["dcZqts2"].isNull())
	{
		m_dcZqts2 = jsonData["dcZqts2"].asInt();
	}
	CUtils::getJsonStringField(jsonData, "dcZqrx2", m_dcZqrx2);
	CUtils::getJsonStringField(jsonData, "bankXfJhje", m_bankXfJhje);
	CUtils::getJsonStringField(jsonData, "bankXfSjje", m_bankXfSjje);
	CUtils::getJsonStringField(jsonData, "xycJsje", m_xycJsje);
	CUtils::getJsonStringField(jsonData, "xycSdyj", m_xycSdyj);
	CUtils::getJsonStringField(jsonData, "qkMemo", m_qkMemo);

	CUtils::getJsonStringField(jsonData, "memo1", m_memo1);
	CUtils::getJsonStringField(jsonData, "memo2", m_memo2);
	CUtils::getJsonStringField(jsonData, "memo3", m_memo3);
	CUtils::getJsonStringField(jsonData, "memo4", m_memo4);
	CUtils::getJsonStringField(jsonData, "memo5", m_memo5);
	CUtils::getJsonStringField(jsonData, "memo6", m_memo6);
	CUtils::getJsonStringField(jsonData, "memo7", m_memo7);
	CUtils::getJsonStringField(jsonData, "memo8", m_memo8);
	CUtils::getJsonStringField(jsonData, "memo9", m_memo9);
	CUtils::getJsonStringField(jsonData, "memo10", m_memo10);
	CUtils::getJsonStringField(jsonData, "memo11", m_memo11);
	CUtils::getJsonStringField(jsonData, "memo12", m_memo12);
	CUtils::getJsonStringField(jsonData, "memo13", m_memo13);
	CUtils::getJsonStringField(jsonData, "memo14", m_memo14);
	CUtils::getJsonStringField(jsonData, "memo15", m_memo15);
	CUtils::getJsonStringField(jsonData, "memo16", m_memo16);
	CUtils::getJsonStringField(jsonData, "memo17", m_memo17);
	CUtils::getJsonStringField(jsonData, "memo18", m_memo18);
	CUtils::getJsonStringField(jsonData, "memo19", m_memo19);
	CUtils::getJsonStringField(jsonData, "memo20", m_memo20);
	CUtils::getJsonStringField(jsonData, "memo21", m_memo21);
	CUtils::getJsonStringField(jsonData, "memo22", m_memo22);
	CUtils::getJsonStringField(jsonData, "memo23", m_memo23);
	CUtils::getJsonStringField(jsonData, "memo24", m_memo24);
	CUtils::getJsonStringField(jsonData, "memo25", m_memo25);
}

void CPledgeDiYaModel::toJsonData(Json::Value& jsonData)
{
	char szContent[4000] = {0};
	if (m_id > 0)
	{
		jsonData["diyaID"] = m_id;
	}
	if (m_productID > 0)
	{
		jsonData["productID"] = m_productID;
	}
	if (m_tdType.GetLength() > 0)
	{
		CChineseCode::Convert(m_tdType.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["tdType"] = szContent;
	}
	if (m_loanBank.GetLength())
	{
		CChineseCode::Convert(m_loanBank.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["loanBank"] = szContent;
	}
	if (m_bankJhrq > 0)
	{
		jsonData["bankJhrq"] = m_bankJhrq;
	}
	if (m_bankSjrq > 0)
	{
		jsonData["bankSjrq"] = m_bankSjrq;
	}
	if (m_zlfCzrq > 0)
	{
		jsonData["zlfCzrq"] = m_zlfCzrq;
	}
	if (m_zlfJe.GetLength() > 0)
	{
		CChineseCode::Convert(m_zlfJe.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["zlfJe"] = szContent;
	}
	if (m_pgfCzrq > 0)
	{
		jsonData["pgfCzrq"] = m_pgfCzrq;
	}
	if (m_pgfCzje.GetLength() > 0)
	{
		CChineseCode::Convert(m_pgfCzje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["pgfCzje"] = szContent;
	}
	if (m_pfrqJhrq > 0)
	{
		jsonData["pfrqJhrq"] = m_pfrqJhrq;
	}
	if (m_pfrqSjrq > 0)
	{
		jsonData["pfrqSjrq"] = m_pfrqSjrq;
	}
	if (m_gzJhrq > 0)
	{
		jsonData["gzJhrq"] = m_gzJhrq;
	}
	if (m_gzSjrq > 0)
	{
		jsonData["gzSjrq"] = m_gzSjrq;
	}
	if (m_slJhckrq > 0)
	{
		jsonData["slJhckrq"] = m_slJhckrq;
	}
	if (m_slCksjrq > 0)
	{
		jsonData["slCksjrq"] = m_slCksjrq;
	}
	if (m_slAjjhje.GetLength() > 0)
	{
		CChineseCode::Convert(m_slAjjhje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["slAjjhje"] = szContent;
	}
	if (m_slAjsjje.GetLength() > 0)
	{
		CChineseCode::Convert(m_slAjsjje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["slAjsjje"] = szContent;
	}
	if (m_slBankjqbj.GetLength() > 0)
	{
		CChineseCode::Convert(m_slBankjqbj.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["slBankjqbj"] = szContent;
	}
	if (m_slBankjqlx.GetLength() > 0)
	{
		CChineseCode::Convert(m_slBankjqlx.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["slBankjqlx"] = szContent;
	}
	if (m_slHtje.GetLength() > 0)
	{
		CChineseCode::Convert(m_slHtje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["slHtje"] = szContent;
	}
	if (m_slSjsyje.GetLength() > 0)
	{
		CChineseCode::Convert(m_slSjsyje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["slSjsyje"] = szContent;
	}
	if (m_slHtts > 0)
	{
		jsonData["slHtts"] = m_slHtts;
	}
	if (m_slHtrx.GetLength() > 0)
	{
		CChineseCode::Convert(m_slHtrx.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["slHtrx"] = szContent;
	}
	if (m_slSjts > 0)
	{
		jsonData["slSjts"] = m_slSjts;
	}
	if (m_slSjrx.GetLength() > 0)
	{
		CChineseCode::Convert(m_slSjrx.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["slSjrx"] = szContent;
	}
	if (m_slZqts > 0)
	{
		jsonData["slZqts"] = m_slZqts;
	}
	if (m_slZqrx.GetLength() > 0)
	{
		CChineseCode::Convert(m_slZqrx.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["slZqrx"] = szContent;
	}
	if (m_dydjJhrq > 0)
	{
		jsonData["dydjJhrq"] = m_dydjJhrq;
	}
	if (m_dydjSjrq > 0)
	{
		jsonData["dydjSjrq"] = m_dydjSjrq;
	}
	if (m_dydjCzrq > 0)
	{
		jsonData["dydjCzrq"] = m_dydjCzrq;
	}
	if (m_dydjCzje.GetLength() > 0)
	{
		CChineseCode::Convert(m_dydjCzje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["dydjCzje"] = szContent;
	}
	if (m_txfJhje.GetLength() > 0)
	{
		CChineseCode::Convert(m_txfJhje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["txfJhje"] = szContent;
	}
	if (m_txfSjje.GetLength() > 0)
	{
		CChineseCode::Convert(m_txfSjje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["txfSjje"] = szContent;
	}
	if (m_dgzhJhje.GetLength() > 0)
	{
		CChineseCode::Convert(m_dgzhJhje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["dgzhJhje"] = szContent;
	}
	if (m_dgzhSjje.GetLength() > 0)
	{
		CChineseCode::Convert(m_dgzhSjje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["dgzhSjje"] = szContent;
	}
	if (m_dcJhrq > 0)
	{
		jsonData["dcJhrq"] = m_dcJhrq;
	}
	if (m_dcSjrq > 0)
	{
		jsonData["dcSjrq"] = m_dcSjrq;
	}
	if (m_dcJhje.GetLength() > 0)
	{
		CChineseCode::Convert(m_dcJhje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["dcJhje"] = szContent;
	}
	if (m_dcSjje.GetLength() > 0)
	{
		CChineseCode::Convert(m_dcSjje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["dcSjje"] = szContent;
	}
	if (m_dcJhts > 0)
	{
		jsonData["dcJhts"] = m_dcJhts;
	}
	if (m_dcSjts > 0)
	{
		jsonData["dcSjts"] = m_dcSjts;
	}
	if (m_dcJhrx.GetLength() > 0)
	{
		CChineseCode::Convert(m_dcJhrx.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["dcJhrx"] = szContent;
	}
	if (m_dcSjrx.GetLength() > 0)
	{
		CChineseCode::Convert(m_dcSjrx.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["dcSjrx"] = szContent;
	}
	if (m_dcZqts1 > 0)
	{
		jsonData["dcZqts1"] = m_dcZqts1;
	}
	if (m_dcZqrx1.GetLength() > 0)
	{
		CChineseCode::Convert(m_dcZqrx1.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["dcZqrx1"] = szContent;
	}
	if (m_dcZqts2 > 0)
	{
		jsonData["dcZqts2"] = m_dcZqts2;
	}
	if (m_dcZqrx2.GetLength() > 0)
	{
		jsonData["dcZqrx2"] = m_dcZqrx2.GetBuffer();
	}
	if (m_bankXfJhje.GetLength() > 0)
	{
		CChineseCode::Convert(m_bankXfJhje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["bankXfJhje"] = szContent;
	}
	if (m_bankXfSjje.GetLength() > 0)
	{
		CChineseCode::Convert(m_bankXfSjje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["bankXfSjje"] = szContent;
	}
	if (m_xycJsje.GetLength() > 0)
	{
		CChineseCode::Convert(m_xycJsje.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["xycJsje"] = szContent;
	}
	if (m_xycSdyj.GetLength() > 0)
	{
		CChineseCode::Convert(m_xycSdyj.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["xycSdyj"] = szContent;
	}
	if (m_qkMemo.GetLength() > 0)
	{
		CChineseCode::Convert(m_qkMemo.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["qkMemo"] = szContent;
	}

	if (m_memo1.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo1.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo1"] = szContent;
	}
	if (m_memo2.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo2.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo2"] = szContent;
	}
	if (m_memo3.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo3.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo3"] = szContent;
	}
	if (m_memo4.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo4.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo4"] = szContent;
	}
	if (m_memo5.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo5.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo5"] = szContent;
	}
	if (m_memo6.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo6.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo6"] = szContent;
	}
	if (m_memo7.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo7.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo7"] = szContent;
	}
	if (m_memo8.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo8.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo8"] = szContent;
	}
	if (m_memo9.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo9.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo9"] = szContent;
	}
	if (m_memo10.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo10.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo10"] = szContent;
	}
	if (m_memo11.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo11.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo11"] = szContent;
	}
	if (m_memo12.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo12.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo12"] = szContent;
	}
	if (m_memo13.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo13.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo13"] = szContent;
	}
	if (m_memo14.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo14.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo14"] = szContent;
	}
	if (m_memo15.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo15.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo15"] = szContent;
	}
	if (m_memo16.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo16.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo16"] = szContent;
	}
	if (m_memo17.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo17.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo17"] = szContent;
	}
	if (m_memo18.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo18.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo18"] = szContent;
	}
	if (m_memo19.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo19.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo19"] = szContent;
	}
	if (m_memo20.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo20.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo20"] = szContent;
	}
	if (m_memo21.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo21.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo21"] = szContent;
	}
	if (m_memo22.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo22.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo22"] = szContent;
	}
	if (m_memo23.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo23.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo23"] = szContent;
	}
	if (m_memo24.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo24.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo24"] = szContent;
	}
	if (m_memo25.GetLength() > 0)
	{
		CChineseCode::Convert(m_memo25.GetBuffer(), szContent, CP_ACP, CP_UTF8);
		jsonData["memo25"] = szContent;
	}

}



